import Relay from "react-relay";

export default class LoginMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { login }`;
    }

    getVariables() {
        return {
            argsInput: {
                password: this.props.password,
                username: this.props.username,
                token: this.props.token,
                pageNum: this.props.pageNum,
                pageSize: this.props.pageSize,
                phone:this.props.phone
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on loginPayload {
            login {
                errorCode
                value
                totalResult
                id
                token
                userModel{
                    depName
                    roleName
                    phone
                    roleId
                    uid
                    name
                    enterpriseDomainList{
                    enterpriseName
                    }
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on loginPayload {
                    login {
                        errorCode
                        value
                        totalResult
                        id
                        token
                        userModel{
                            depName
                            roleName
                            phone
                            roleId
                            uid
                            name
                            enterpriseDomainList{
                            enterpriseName
                            }
                        }

                    }
                }
            `]
        }];
    }

}
